/*oOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoO

Authors: Nitay Megides
		 Rachel Banino

Project: Exercise 1

Using: Hw1Types.h

Description:
A general module for general functions. Used throughout the project
oOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoO*/

#ifndef GENERAL_H
#define GENERAL_H

#define MAX_NAME_LEN 256

#include <stdio.h>
#include "Hw1Types.h"


///////////////////////////////////////////////
// Assertion Helpers
void AssertOutOfMemory(void* ptr);
void AssertFileOpenError(void* ptr);
void AssertFileError(BOOL bytesWritenEqualsBytesSent);
void AssertFileSizeError(int fileSize);
void AssertProduct(void* product);
void AssertUser(void* user);

void WriteAndAssert(FILE* file, void* data, size_t size);
void ReadAndAssert(FILE* file, void* buffer, size_t size);

#endif // GENERAL_H